#include "publib.h"

int fill_user_info(User* user) {
    if (!input_user_role(user->role, sizeof(user->role))) return 0;
    if (!input_user_nickname(user->nickname, sizeof(user->nickname))) return 0;
    if (!input_user_username(user->username, sizeof(user->username))) return 0;
    if (!input_user_id(user->id, sizeof(user->id))) return 0;

    if (strcmp(user->role, "teacher") == 0 || strcmp(user->role, "student") == 0) {
        if (!input_user_realname(user->realname, sizeof(user->realname))) return 0;
        if (!select_college_and_major(user->collegename, sizeof(user->collegename),
            user->majorname, sizeof(user->majorname))) return 0;
    }
    print_save_complated_message();
    clear_with_countdown(2);
    return 1;
}
